Skip to content

feat(lint): extract static metadata validators into @objectstack/lint (ADR-0019 P3)#2215

Merged
xuyushun441-sys merged 2 commits into
mainfrom
feat/objectstack-lint
Jun 22, 2026
Merged

feat(lint): extract static metadata validators into @objectstack/lint (ADR-0019 P3)#2215
xuyushun441-sys merged 2 commits into
mainfrom
feat/objectstack-lint

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

ADR-0019 Phase 3. Gives the pure, build-time metadata validators a clean public home so consumers other than the CLI (notably the AI build) can run them — instead of being trapped in cli/src/utils/ where only the CLI can reach them.

What

  • New package @objectstack/lint — pure (stack) => Finding[] validators, no I/O, no runtime, never bundled into a frontend.
  • First release moves the two the AI build needs (neither depends on the others):
    • validateWidgetBindings (ADR-0021 — widget→dataset→measure/dimension + measure-aggregation coherence)
    • validateStackExpressions (ADR-0032 — CEL/predicate validity)
  • @objectstack/cli imports both from @objectstack/lint (was ./utils/*) — pure move, no behavior change.

Why not in @objectstack/spec

spec is the frontend-facing contract (ships to the browser). Build-time validators don't belong there — it inverts layering and bloats the frontend bundle. Dependency direction is one-way lint → spec.

Scope

Filesystem-coupled (lint-liveness-properties) and command-coupled (score → cli's lintConfig) checks deliberately stay in the CLI for a later increment.

Verification

  • @objectstack/lint builds (ESM + CJS + DTS); 62 moved tests pass.
  • @objectstack/cli rebuilds clean consuming the package (type-level + runtime import verified).
  • No stray references to the old ./utils/* paths anywhere in the tree.

Next (separate PR): cloud's AI build (service-ai-studio) assembles its staged drafts into a stack and runs these validators at verify_build (ADR-0019 P2).

🤖 Generated with Claude Code

… (ADR-0019 P3)

New public package @objectstack/lint holds the pure, build-time metadata
validators as (stack) => Finding[] functions, so the same rules run wherever a
stack can be assembled — the CLI's `os validate`/`compile` and any other
consumer (notably AI authoring) — instead of being trapped in CLI internals.

First release moves the two the AI build needs:
- validateWidgetBindings (ADR-0021 widget→dataset→measure/dimension + aggregation coherence)
- validateStackExpressions (ADR-0032 CEL/predicate validity)

@objectstack/cli imports both from @objectstack/lint (was ./utils/*) — pure move,
no behavior change (cli builds, 62 moved tests pass). Dependency direction is
one-way lint→spec; never a runtime dep, never bundled into a frontend — which is
why these do NOT live in the frontend-facing @objectstack/spec.

Filesystem-coupled (lint-liveness-properties) and command-coupled (score→lintConfig)
checks stay in the CLI for a later increment.
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 22, 2026 3:03pm

Request Review

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file tests tooling and removed size/m labels Jun 22, 2026
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/cli, @objectstack/lint.

15 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/concepts/cloud-artifact-api.mdx (via packages/cli)
  • content/docs/concepts/implementation-status.mdx (via @objectstack/cli)
  • content/docs/concepts/packages.mdx (via @objectstack/cli)
  • content/docs/getting-started/cli.mdx (via @objectstack/cli)
  • content/docs/getting-started/quick-start.mdx (via @objectstack/cli)
  • content/docs/guides/authentication.mdx (via @objectstack/cli)
  • content/docs/guides/client-sdk.mdx (via @objectstack/cli)
  • content/docs/guides/hook-bodies.mdx (via packages/cli)
  • content/docs/guides/packages.mdx (via @objectstack/cli)
  • content/docs/guides/project-scoping.mdx (via @objectstack/cli)
  • content/docs/guides/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/guides/runtime-services/index.mdx (via packages/cli)
  • content/docs/guides/skills.mdx (via packages/cli)
  • content/docs/protocol/objectos/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/objectos/realtime-protocol.mdx (via @objectstack/cli)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

New public package must be in the changesets 'fixed' lockstep group (CI gate
'Validate Package Dependencies').
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants